{template header}
<script type="text/javascript" src="{GODHOUSE_DOMAIN_IMAGE}js/calendar.js"></script>
<script type="text/javascript" src="{GODHOUSE_DOMAIN_IMAGE}js/calendar-zh.js"></script>
<link href="{GODHOUSE_DOMAIN_IMAGE}css/calendar.css" rel="stylesheet" type="text/css" />
<div class="path">
	<span><a href="user-admin.htm">用户管理</a></span>
	<span>修改用户</span>
</div>
<div class="content">
	<div class="c1">
	<form action="user-update-$user[userId].htm" method="post" onsubmit="return verifyFrom();">
	      <table width="100%" border="0" cellspacing="2" cellpadding="2" style="text-align:center">
	        <tr>
	          <td width="15%" height="30" align="right">用户名：</td>
	          <td width="85%" align="left">
	          <input type="text" name="user[userName]" id="userName" value="$user[userName]" disabled="disabled" />
	          </td>
	          </tr>
	        <tr>
	          <td height="30" align="right">密　码：</td>
	          <td align="left"><input type="password" name="user[passwd]" id="passwd" value="" /><span id="err_passwd"></span></td>
	          </tr>
	          <tr>
	          <td height="30" align="right">确认密码：</td>
	          <td align="left"><input type="password" name="passwd2" id="passwd2" /><span id="err_passwd2"></span></td>
	          </tr>
	        <tr>
	          <td height="30" align="right">用户等级：</td>
	          <td align="left">
			  <select name="user[groupId]">
			  <!--{loop $groups $k $v}-->
			  <option value="$v[groupId]" {if $v[groupId]==$user[groupId]}selected="selected"{/if}>$v[groupName]</option>
			  <!--{/loop}-->
	          </select></td>
	        </tr>
	        <tr>
	        	<td height="30" align="right">真实姓名：</td>
	          	<td align="left"><input type="text" name="user[realName]" value="$user[realName]"/></td>
	        </tr>  
	        <tr>
	        	<td height="30" align="right">手机号码：</td>
	          	<td align="left"><input type="text" name="user[mobile]" value="$user[mobile]" /></td>
	        </tr> 
	        <tr>
	        	<td height="30" align="right">联系电话：</td>
	          	<td align="left"><input type="text" name="user[phone]" value="$user[phone]" /></td>
	        </tr>
	        <tr>
	        	<td height="30" align="right">邮箱：</td>
	          	<td align="left"><input type="text" name="user[email]" id="email" value="$user[email]" /><span id="err_email"></span></td>
	        </tr> 
	        <tr>
	        	<td height="30" align="right">积分：</td>
	          	<td align="left"><input type="text" name="user[credit]" id="credit" value="$user[credit]" /></td>
	        </tr>
	        <tr>
	        	<td height="30" align="right">累计积分：</td>
	          	<td align="left"><input type="text" name="user[creditTotal]" id="creditTotal" value="$user[creditTotal]" /></td>
	        </tr>
	        <tr>
	        	<td height="30" align="right">公司名称：</td>
	          	<td align="left"><input type="text" name="user[company]" id="company" value="$user[company]" /><span id="err_company"></span></td>
	        </tr>
	        <tr>
	        	<td height="30" align="right">地区：</td>
	        	<td align="left"><select name="province" id="province" style="width: 150px;" onchange="ajaxget('user-ajaxCity-'+this.value+'.htm', 'showCity', 'showCity', null, null)">
				<option value="">请选择区域</option>
				<!--{loop $areaList $v}-->
				<option value="{$v[id]}" {if $area[fId]==$v[id]}selected="selected"{/if}>{$v[name]}</option>
				<!--{/loop}-->
			</select>
			<span id="showCity">
			<select name="user[areaId]" id="city" style="width: 150px;">
				<option value="">请选择区域</option>
				<!--{loop $subAreaList $v}-->
				<option value="{$v[id]}" {if $user[areaId]==$v[id]}selected="selected"{/if}>{$v[name]}</option>
				<!--{/loop}-->
			</select>
			</span>
			<span style="color:red" id="err_city"></span></td>
	        </tr>
	        <tr>
	        	<td height="30" align="right">地址：</td>
	          	<td align="left"><input type="text" name="user[address]" value="$user[address]" /></td>
	        </tr>
	        <tr>
	        	<td height="30" align="right">邮编：</td>
	          	<td align="left"><input type="text" name="user[postCode]" value="$user[postCode]" /></td>
	        </tr>
	        <tr>
	        	<td height="30" align="right">所属管理员：</td>
	          	<td align="left"><input type="text" name="user[parentId]" value="$user[parentName]" id="parentId" onpropertychange="ajaxget('user-checkParentUser.htm?userName='+this.value, 'err_parentId', 'err_parentId', null, null)" /><span id="err_parentId"></span></td>
	        </tr>
	        <tr>
	          <td height="30" align="right">&nbsp;</td>
	          <td align="left">
			<input type="submit" class="bigButton" name="submitTo" value="  提交  " />
	          </td>
	        </tr>
	      </table>
	      </form>
	</div>
</div>
<script>
function verifyFrom() {
	var company = $('company');
	if(company.value == '') {
		$('company').focus();
		$('err_company').innerHTML = '<span style="color:red">&nbsp;&nbsp;&nbsp;&nbsp;请填写公司名称</span>';
		return false;
	}
	var userName = $('userName');
	if(userName.value == '') {
		$('userName').focus();
		$('err_userName').innerHTML = '<span style="color:red">&nbsp;&nbsp;&nbsp;&nbsp;请填写注册帐号 范围a_zA_Z0_9</span>';
		return false;
	}
	var passwd = $('passwd');
	var passwd2 = $('passwd2');
	if(passwd.value != passwd2.value) {
		$('passwd2').focus();
		$('err_passwd2').innerHTML = '<span style="color:red">&nbsp;&nbsp;&nbsp;&nbsp;与确认密码不一致</span>';
		return false;
	}
	var email = $('email');
	if(email.value == '') {
		$('email').focus();
		$('err_email').innerHTML = '<span style="color:red">&nbsp;&nbsp;&nbsp;&nbsp;请输入邮箱</span>';
		return false;
	}
	return true;
}
</script>
{template footer}